<script src="/statics/js/jquery.PrintArea.js" type="text/javascript"></script>
<div class="container-fluid" style="padding: 20px 10px 0px 10px">
    <div class="row-fluid">
        <div class="well">
            <div id="myTabContent" class="tab-content">
                <div class="tab-pane active in" id="printTable">
                    <style>
                        #printTable table tr td{ border: solid 1px;}
                    </style>
                    <table style="width: 600px">
                        <h2 style="text-align: center; font-size: 24px;">
                            嗨呗公主发货单
                        </h2>
                        <tr>
                            <td>单据日期:<?=date('y-m-d',time())?></td>
                            <td>收件人:</td>
                            <td colspan="2"><?=$order_send['receive_name']?></td>
                        </tr>
                        <tr>
                            <td>往来单位:</td>
                            <td>联系方式:</td>
                            <td colspan="2"><?=$order_send['receive_mobile']?></td>
                        </tr>
                        <tr>
                            <td>送货地址:</td>
                            <td colspan="3"><?=$order_send['receive_address']?></td>
                        </tr>
                        <tr>
                            <td>订单号</td>
                            <td colspan="2">商品名称</td>
                            <td>数量</td>
                        </tr>
                        <?php
				  		$nums = 0;
				  		$price = 0;
						$sql = "SELECT a.goods_title,a.pay_nums,a.pay_price,a.express_num
								FROM fx_order_collect a
								LEFT JOIN fx_goods_entity b
								ON a.goods_id=b.goods_id
								WHERE b.resource=2 AND a.order_id=".$order_send['order_id'];
						$getGoods = CQuery($sql);
						if($getGoods){
						foreach($getGoods AS $vv){
						$nums += $vv['pay_nums'];
						$price += $vv['pay_price'];
						if(!$vv['express_num']){
							$express = true;
						}
					?>

                        <tr>
                            <td><?=$order_send['order_id']?></td>
                            <td colspan="2"><?=$vv['goods_title']?></td>
                            <td><?=$vv['pay_nums']?></td>
                        </tr>
                        <?php }}else{?>
                        <tr>
                            <td style="text-align:center;" colspan=3>
                                没有数据
                            </td>
                        </tr>
                        <?php }?>
                        <!--<tr>
                            <td>合计:</td>
                            <td colspan="2"></td>
                            <td>1</td>
                        </tr>-->
                        <tr>
                            <td>制单人:</td>
                            <td>财务:</td>
                            <td>发货人:</td>
                            <td></td>
                        </tr>
                        <tr>
                            <td>收货人:</td>
                            <td colspan="3"></td>
                        </tr>
                        <tr>
                            <td>订单备注:</td>
                            <td colspan="3"><?=$order_send['remark']?></td>
                        </tr>
                        <tr>
                            <td colspan="4">嗨呗公主 联系电话:0571-81389134</td>
                        </tr>
                    </table>
                </div>
                <div class="btn-toolbar">
                    <button class="btn btn-primary orderPrint" style="margin-left:300px" id="btn-save">确认打印</button>
                </div>
            </div>
        </div>
    </div>
</div>
<script type="text/javascript">
    $(document).on('click','.orderPrint',function(){
        $('#printTable').printArea();
    })
</script>